package club.xyes.zkh.ecommerce.dao.mapper;

import club.xyes.zkh.ecommerce.commons.entity.CommodityClassification;
import club.xyes.zkh.ecommerce.dao.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Create by 郭文梁 2019/4/17 0017 10:03
 * CommodityClassificationMapper
 * 商铺分类相关数据库访问组件
 *
 * @author 郭文梁
 * @data 2019/4/17 0017
 */
@Repository
public interface CommodityClassificationMapper extends BaseMapper<CommodityClassification> {
    /**
     * 根据用户ID查询用户所拥有的店铺的商铺分类
     *
     * @param userId 用户ID
     * @return 店铺商铺分类
     */
    List<CommodityClassification> selectByUserId(@Param("userId") Integer userId);

    /**
     * 通过ShopId查询分类下的商品数量
     *
     * @param shopId 商铺ID
     * @return list map
     */
    List<Map<String, Object>> selectCommodityCountByShopId(@Param("shopId") Integer shopId);
}
